using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace NoteManger
{
	public class NoteClientCtl : UserControl
	{
		public delegate void AddNodesCallback(TreeNode aParentNode, TreeNode aTheNodeWhobeadd);
		public delegate void SetProcessCallback(string aNodeText, TreeNode aNode, int aImageIndex);
		public class ThreadProcObject
		{
			private NoteRemote _NoteRemoteObject = null;
			private TLoginInfo _LoginInfo = null;
			private string _YearMonthText = null;
			private TreeNode _ParentNode = null;
			private TreeNode _RootNode = null;
			private TreeView _TreeViewNote = null;
			public NoteRemote NoteRemoteObject
			{
				get
				{
					return this._NoteRemoteObject;
				}
				set
				{
					this._NoteRemoteObject = value;
				}
			}
			public TLoginInfo LoginInfo
			{
				get
				{
					return this._LoginInfo;
				}
				set
				{
					this._LoginInfo = value;
				}
			}
			public string YearMonthText
			{
				get
				{
					return this._YearMonthText;
				}
				set
				{
					this._YearMonthText = value;
				}
			}
			public TreeNode ParentNode
			{
				get
				{
					return this._ParentNode;
				}
				set
				{
					this._ParentNode = value;
				}
			}
			public TreeNode RootNode
			{
				get
				{
					return this._RootNode;
				}
				set
				{
					this._RootNode = value;
				}
			}
			public TreeView TreeViewNote
			{
				get
				{
					return this._TreeViewNote;
				}
				set
				{
					this._TreeViewNote = value;
				}
			}
			public void AddNodes(TreeNode aParentNode, TreeNode aTheNodeWhoWillBeAdd)
			{
				aParentNode.Nodes.Add(aTheNodeWhoWillBeAdd);
			}
			public void SetProcess(string aNodeText, TreeNode aNode, int aImageIndex)
			{
				aNode.Text = aNodeText;
				aNode.ImageIndex = aImageIndex;
			}
		}
		private FrmEditNote objFrmEditNote = null;
		private bool b_IsFreeMode = true;
		private bool b_FirstShow = true;
		private bool[] ThreadAllDone = new bool[0];
		private string LastNewNoteID = "";
		private TreeNode rootNode = new TreeNode();
		private static int iMonths = 0;
		private static int iTopChars = 0;
		private NoteRemote NoteRemoteObject = null;
		private bool Connected = false;
		private bool b_FirstConnect = true;
		private TLoginInfo _LoginInfo = new TLoginInfo();
		private IContainer components = null;
		private ImageList imageList;
		private MenuStrip menuStrip;
		private ToolStripMenuItem mmFile;
		private ToolStripMenuItem mmConnect;
		private ToolStripMenuItem mmLogin;
		private ToolStripMenuItem mmNewUser;
		private ToolStripMenuItem mmRefresh;
		private ToolStripMenuItem mmAlterPwd;
		private ToolStripSeparator toolStripSeparator2;
		private ToolStripSeparator toolStripSeparator3;
		private ToolStripMenuItem mmMangerTask;
		private ToolStripMenuItem mmPurviewMange;
		private ToolStripMenuItem mmNoteCheck;
		private ToolStripMenuItem mmLogout;
		private ContextMenuStrip contextMenuStrip;
		private ToolStripMenuItem pmEditNote;
		private ToolStripMenuItem pmDeleteNote;
		private ToolStripMenuItem pmUpLoadNote;
		private ToolStripMenuItem pmViewNoteInfo;
		private ToolStripSeparator toolStripSeparator4;
		private ToolStripMenuItem pmRefresh;
		private ToolStripSeparator toolStripSeparator5;
		private ToolStripMenuItem pmAlterNote;
		public TreeView treeViewNote;
		private ToolStripSeparator toolStripSeparator6;
		private ToolStripMenuItem mmSysBasicData;
		private ToolStripMenuItem mmClearUserPwd;
		private ToolStripSeparator toolStripSeparator7;
		private ToolStripMenuItem mmSelfTask;
		private ToolStripMenuItem mmEditNote;
		private ToolStripMenuItem mmDeleteNote;
		private ToolStripMenuItem mmAlterNote;
		private ToolStripMenuItem mmUpLoadNote;
		private ToolStripSeparator toolStripSeparator1;
		private ToolStripMenuItem mmViewNoteInfo;
		private ToolStripSeparator toolStripSeparator8;
		private ToolStripSeparator toolStripSeparator9;
		private ToolStripMenuItem mmClientConfig;
		private ToolStripMenuItem mmWorkLoadAuditQuery;
		private ToolStripMenuItem mmDownLoadNote;
		private ToolStripMenuItem mmNoteQuery;
		private ToolStripMenuItem mmSynchronous;
		private System.Windows.Forms.Timer timLocateToday;
		private ToolStripSeparator toolStripMenuItem1;
		private ToolStripMenuItem mmSendMsg;
		private ToolStripSeparator toolStripSeparator10;
		private ToolStripMenuItem pmNoteQuery;
		private ToolStripMenuItem pmSynchronous;
		private System.Windows.Forms.Timer timLocateLastEditNote;
		private ToolStripMenuItem mmViewWjwshrz;
		private System.Windows.Forms.Timer timQueryWjwsh;
		private ToolStripSeparator toolStripMenuItem2;
		private ToolStripMenuItem mmWeekMonthSchedule;
		private ToolStripSeparator toolStripMenuItem3;
		private ToolStripMenuItem mmDepCommunicationBook;
		private ToolStripMenuItem mmHelp;
		private ToolStripMenuItem mmBug;
		private ToolStripMenuItem mmHelpCenter;
		private ToolStripSeparator toolStripMenuItem4;
		private ToolStripMenuItem mmjkgzlMgr;
		public NoteClientCtl()
		{
			this.InitializeComponent();
		}
		private void NoteClientCtl_Load(object sender, EventArgs e)
		{
			this.rootNode.ImageIndex = 0;
			this.rootNode.Tag = new TAGDATA();
			this.treeViewNote.Nodes.Add(this.rootNode);
			this.mmConnect_Click(null, null);
			this.SetMemuImage();
			this.SaveRemoteExpandFieldTypeToLocalMdb();
			this.SaveRemoteExpandFieldDefineToLocalMdb();
		}
		private void SetMemuImage()
		{
			this.mmSendMsg.Image = this.imageList.Images[4];
			this.mmConnect.Image = this.imageList.Images[5];
			this.mmLogin.Image = this.imageList.Images[6];
			this.mmLogout.Image = this.imageList.Images[7];
			this.mmAlterPwd.Image = this.imageList.Images[8];
			this.mmNewUser.Image = this.imageList.Images[9];
			this.mmClientConfig.Image = this.imageList.Images[10];
			this.mmRefresh.Image = this.imageList.Images[11];
			this.mmEditNote.Image = this.imageList.Images[12];
			this.mmDeleteNote.Image = this.imageList.Images[3];
			this.mmAlterNote.Image = this.imageList.Images[13];
			this.mmSynchronous.Image = this.imageList.Images[14];
			this.mmNoteQuery.Image = this.imageList.Images[15];
			this.mmNoteCheck.Image = this.imageList.Images[16];
			this.mmSysBasicData.Image = this.imageList.Images[17];
			this.mmPurviewMange.Image = this.imageList.Images[18];
			this.mmClearUserPwd.Image = this.imageList.Images[19];
			this.mmViewNoteInfo.Image = this.imageList.Images[20];
			this.mmUpLoadNote.Image = this.imageList.Images[21];
			this.pmDeleteNote.Image = this.imageList.Images[3];
			this.pmRefresh.Image = this.imageList.Images[11];
			this.pmEditNote.Image = this.imageList.Images[12];
			this.pmAlterNote.Image = this.imageList.Images[13];
			this.pmSynchronous.Image = this.imageList.Images[14];
			this.pmNoteQuery.Image = this.imageList.Images[15];
			this.pmViewNoteInfo.Image = this.imageList.Images[20];
			this.pmUpLoadNote.Image = this.imageList.Images[21];
		}
		private void AutoLogin()
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmUserLogin frmUserLogin = new FrmUserLogin();
			frmUserLogin.NoteRemoteObject = this.NoteRemoteObject;
			frmUserLogin.AutoLogin = true;
			if (frmUserLogin.ShowDialog() == DialogResult.OK)
			{
				this._LoginInfo = frmUserLogin.LoginInfo;
				if (this._LoginInfo.LoginSuccess)
				{
					this.mmLogin.Text = "更改用户(&U)";
				}
				frmUserLogin.Dispose();
				this.mmRefresh_Click(null, null);
			}
			this.SetMemuEnabled();
		}
		private string GetAutoLoginFlag()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("ArrowAutoLogin");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private string GetNoteServerAddress()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("NoteServerAddress");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private string GetNoteServerPort()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("NoteServerPort");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private double GetAlarm0()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("Alarm0");
			double result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = 0.0;
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = Convert.ToDouble(value);
			}
			return result;
		}
		private double GetAlarm1()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("Alarm1");
			double result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = 0.0;
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = Convert.ToDouble(value);
			}
			return result;
		}
		private void ConnectServer()
		{
			FrmConnectServer frmConnectServer = new FrmConnectServer();
			frmConnectServer.ServerAddress = this.GetNoteServerAddress();
			frmConnectServer.ServerPort = this.GetNoteServerPort();
			if (this.b_FirstConnect)
			{
				if (frmConnectServer.ServerAddress == "")
				{
					frmConnectServer.ShowDialog();
				}
				else
				{
					if (!frmConnectServer.ThreadConnect())
					{
						frmConnectServer.ShowDialog();
					}
				}
				this.b_FirstConnect = false;
			}
			else
			{
				frmConnectServer.ShowDialog();
			}
			this.NoteRemoteObject = frmConnectServer.ObjectNoteRemote;
			this.Connected = frmConnectServer.Connected;
			frmConnectServer.Dispose();
			GC.Collect();
			this.SetMemuEnabled();
		}
		private void mmConnect_Click(object sender, EventArgs e)
		{
			this.ConnectServer();
			if (this.Connected)
			{
				if (this.mmLogin.Text == "登录(&L)")
				{
					string autoLoginFlag = this.GetAutoLoginFlag();
					if (autoLoginFlag == "true")
					{
						this.AutoLogin();
					}
				}
			}
		}
		private void StateReset()
		{
			this.NoteRemoteObject = null;
			this.Connected = false;
			this._LoginInfo.LoginSuccess = false;
			this._LoginInfo.LoginID = "";
			this._LoginInfo.LoginName = "";
			this._LoginInfo.DepID = "";
			this._LoginInfo.GroupID = "";
			this._LoginInfo.PurviewID = "";
			this.rootNode.Nodes.Clear();
			this.rootNode.Text = "<未连接、未登录>";
			this.mmLogin.Text = "登录(&L)";
			this.SetMemuEnabled();
			GC.Collect();
		}
		private void mmLogin_Click(object sender, EventArgs e)
		{
			if (this.Connected)
			{
				if (this.mmLogin.Text == "登录(&L)")
				{
					string autoLoginFlag = this.GetAutoLoginFlag();
					if (autoLoginFlag == "true")
					{
						this.AutoLogin();
						return;
					}
				}
			}
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmUserLogin frmUserLogin = new FrmUserLogin();
			frmUserLogin.NoteRemoteObject = this.NoteRemoteObject;
			if (frmUserLogin.ShowDialog() == DialogResult.OK)
			{
				this._LoginInfo = frmUserLogin.LoginInfo;
				if (this._LoginInfo.LoginSuccess)
				{
					this.mmLogin.Text = "更改用户(&U)";
				}
				frmUserLogin.Dispose();
				this.mmRefresh_Click(null, null);
			}
			this.SetMemuEnabled();
		}
		private static void ThreadProc(object stateInfo)
		{
			NoteClientCtl.ThreadProcObject threadProcObject = (NoteClientCtl.ThreadProcObject)stateInfo;
			bool flag = false;
			string[,] array = new string[0, 0];
			string text = "";
			string text2 = "";
			text2 = threadProcObject.ParentNode.Text;
			NoteClientCtl.AddNodesCallback method = new NoteClientCtl.AddNodesCallback(threadProcObject.AddNodes);
			NoteClientCtl.SetProcessCallback method2 = new NoteClientCtl.SetProcessCallback(threadProcObject.SetProcess);
			threadProcObject.TreeViewNote.Invoke(method2, new object[]
			{
				"正在查询<" + text2.Replace("-", "年") + "月>的数据...",
				threadProcObject.ParentNode,
				0
			});
			try
			{
				flag = threadProcObject.NoteRemoteObject.GetNoteListByYearMonth(threadProcObject.LoginInfo.LoginID, threadProcObject.YearMonthText, ref array, ref text);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			if (!flag)
			{
				threadProcObject.RootNode.Text = "我的日志";
				MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				TreeNode treeNode = null;
				string a = "";
				for (int i = array.GetLowerBound(0); i <= array.GetUpperBound(0); i++)
				{
					TreeNode treeNode2 = new TreeNode();
					string str = array[i, 5];
					string text3 = array[i, 6];
					string text4 = "WL:" + str + "," + array[i, 3];
					string aNoteDate = array[i, 4];
					string value = threadProcObject.YearMonthText + "-" + array[i, 0];
					string text5 = array[i, 0];
					DayOfWeek dayOfWeek = Convert.ToDateTime(value).DayOfWeek;
					string text6 = "";
					switch (dayOfWeek)
					{
					case DayOfWeek.Sunday:
						text6 = "星期日";
						break;
					case DayOfWeek.Monday:
						text6 = "星期一";
						break;
					case DayOfWeek.Tuesday:
						text6 = "星期二";
						break;
					case DayOfWeek.Wednesday:
						text6 = "星期三";
						break;
					case DayOfWeek.Thursday:
						text6 = "星期四";
						break;
					case DayOfWeek.Friday:
						text6 = "星期五";
						break;
					case DayOfWeek.Saturday:
						text6 = "星期六";
						break;
					}
					if (text4.Length <= NoteClientCtl.iTopChars)
					{
						treeNode2.Text = "[" + text4 + "]";
					}
					else
					{
						treeNode2.Text = "[" + text4.Substring(0, NoteClientCtl.iTopChars) + "...]";
					}
					if (a != text5)
					{
						a = text5;
						treeNode = new TreeNode();
						treeNode.Text = string.Concat(new string[]
						{
							array[i, 0],
							",",
							text6,
							",WL:",
							text3
						});
						treeNode.Tag = new TAGDATA();
						threadProcObject.TreeViewNote.Invoke(method, new object[]
						{
							threadProcObject.ParentNode,
							treeNode
						});
					}
					if (array[i, 2] == "0")
					{
						treeNode2.Tag = new TAGDATA(array[i, 1], aNoteDate, true, true, true);
						treeNode2.ImageIndex = 1;
					}
					else
					{
						if (array[i, 2] == "1")
						{
							treeNode2.Tag = new TAGDATA(array[i, 1], aNoteDate, false, false, true);
							treeNode2.ForeColor = System.Drawing.Color.Blue;
							treeNode2.ImageIndex = 2;
						}
						else
						{
							if (array[i, 2] == "2")
							{
								treeNode2.Tag = new TAGDATA(array[i, 1], aNoteDate, true, false, true);
								treeNode2.ForeColor = System.Drawing.Color.Red;
								treeNode2.ImageIndex = 3;
							}
						}
					}
					threadProcObject.TreeViewNote.Invoke(method, new object[]
					{
						treeNode,
						treeNode2
					});
				}
				threadProcObject.TreeViewNote.Invoke(method2, new object[]
				{
					text2,
					threadProcObject.ParentNode,
					0
				});
				array = null;
				GC.Collect();
			}
		}
		private Array ChangeArrayLength(Array oriArray, int Count)
		{
			Type elementType = oriArray.GetType().GetElementType();
			Array array = Array.CreateInstance(elementType, Count);
			Array.Copy(oriArray, 0, array, 0, Math.Min(oriArray.Length, Count));
			return array;
		}
        /// <summary>
        /// 加载日志
        /// </summary>
		private void GetNoteListAndFillTreeView()
		{
			if (this.Connected)
			{
				if (this._LoginInfo.LoginSuccess)
				{
					try
					{
						if (!this.NoteRemoteObject.ConnectionTest())
						{
							MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							this.StateReset();
							return;
						}
					}
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						this.StateReset();
						return;
					}
					this.ReadClientConfig();
					string[] array = new string[0];
					string text = "";
					this.rootNode.Nodes.Clear();
					this.rootNode.Text = "<正在从远程服务器获取数据......>";
					this.treeViewNote.Refresh();
					string text2 = "";
					int num = NoteClientCtl.iMonths;
					DateTime now = DateTime.Now;
					for (int i = 0; i < num; i++)
					{
						text2 = text2 + "'" + now.AddMonths(-i).Date.ToString("yyyy-MM-dd").Substring(0, 7) + "',";
					}
					text2 = text2.Substring(0, text2.Length - 1);
					bool flag = false;
					try
					{
						flag = this.NoteRemoteObject.GetNoteListGroupByYearMonth(this._LoginInfo.LoginID, ref array, text2, ref text);
					}
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
					if (!flag)
					{
						this.rootNode.Text = "我的日志";
						MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
					else
					{
						this.ThreadAllDone = (bool[])this.ChangeArrayLength(this.ThreadAllDone, array.Length);
						for (int i = 0; i < array.Length; i++)
						{
							this.ThreadAllDone[i] = false;
							TreeNode treeNode = new TreeNode();
							treeNode.Text = array[i];
							treeNode.Tag = new TAGDATA();
							this.rootNode.Nodes.Add(treeNode);
							this.rootNode.Expand();
							NoteClientCtl.ThreadProcObject threadProcObject = new NoteClientCtl.ThreadProcObject();
							threadProcObject.RootNode = this.rootNode;
							threadProcObject.YearMonthText = array[i];
							threadProcObject.ParentNode = treeNode;
							threadProcObject.LoginInfo = this._LoginInfo;
							threadProcObject.NoteRemoteObject = this.NoteRemoteObject;
							threadProcObject.TreeViewNote = this.treeViewNote;
							ThreadPool.QueueUserWorkItem(new WaitCallback(NoteClientCtl.ThreadProc), threadProcObject);
							this.ThreadAllDone[i] = true;
						}
						this.rootNode.Text = "我的日志 - [" + this._LoginInfo.LoginName + "]";
						array = null;
						GC.Collect();
						if (!this.LocalHasNotes())
						{
							this.mmSynchronous_Click(null, null);
						}
					}
				}
			}
		}
		private void SetMemuEnabled()
		{
			this.mmConnect.Enabled = (!this.Connected && this.b_IsFreeMode);
			this.mmLogin.Enabled = (this.Connected && this.b_IsFreeMode);
			this.mmNewUser.Enabled = (this.Connected && this.b_IsFreeMode);
			this.mmAlterPwd.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmRefresh.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmUpLoadNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmViewWjwshrz.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmLogout.Enabled = (this.Connected && this.b_IsFreeMode);
			this.pmRefresh.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.pmUpLoadNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmDownLoadNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmNoteQuery.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.pmNoteQuery.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmSynchronous.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.pmSynchronous.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmDepCommunicationBook.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmBug.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmSendMsg.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && this.b_IsFreeMode);
			this.mmWeekMonthSchedule.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && (this._LoginInfo.PurviewID == "0" || this._LoginInfo.PurviewID == "1" || this._LoginInfo.PurviewID == "3" || this._LoginInfo.PurviewID == "4") && this.b_IsFreeMode);
			this.mmNoteCheck.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && (this._LoginInfo.PurviewID == "0" || this._LoginInfo.PurviewID == "1" || this._LoginInfo.PurviewID == "4") && this.b_IsFreeMode);
			this.mmPurviewMange.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && (this._LoginInfo.PurviewID == "0" || this._LoginInfo.PurviewID == "3") && this.b_IsFreeMode);
			this.mmSysBasicData.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && (this._LoginInfo.PurviewID == "0" || this._LoginInfo.PurviewID == "3") && this.b_IsFreeMode);
			this.mmClearUserPwd.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && (this._LoginInfo.PurviewID == "0" || this._LoginInfo.PurviewID == "3") && this.b_IsFreeMode);
			this.mmWorkLoadAuditQuery.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && (this._LoginInfo.PurviewID == "0" || this._LoginInfo.PurviewID == "3") && this.b_IsFreeMode);
			this.mmEditNote.Enabled = this.b_IsFreeMode;
			if (!this.Connected && !this._LoginInfo.LoginSuccess)
			{
				this.rootNode.Text = "<未连接、未登录>";
			}
			if (this.Connected && this._LoginInfo.LoginSuccess)
			{
				this.rootNode.Text = "我的日志 - [" + this._LoginInfo.LoginName + "]";
				this.mmLogout.Text = "注销";
			}
			if (!this.Connected && this._LoginInfo.LoginSuccess)
			{
				this.rootNode.Text = "<未连接、已登录>";
			}
			if (this.Connected && !this._LoginInfo.LoginSuccess)
			{
				this.rootNode.Text = "<已连接、未登录>";
				this.mmLogout.Text = "断开连接";
			}
		}
		private int GetNoteInfos(string sBeginDate, string aEndDate, int iGetFlag)
		{
			int result;
			if (this.NoteRemoteObject == null)
			{
				result = 0;
			}
			else
			{
				string[,] array = new string[0, 0];
				try
				{
					if (!this.NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						result = 0;
						return result;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					result = 0;
					return result;
				}
				string text = "";
				bool flag = false;
				try
				{
					if (iGetFlag == 0)
					{
						string text2 = "0";
						flag = this.NoteRemoteObject.CommonQuery(string.Concat(new string[]
						{
							"exec usp_wn_querywjwshnote '",
							sBeginDate,
							"','",
							aEndDate,
							"',",
							text2,
							",",
							iGetFlag.ToString(),
							",'",
							this._LoginInfo.LoginID,
							"'"
						}), ref array, ref text);
					}
					else
					{
						flag = this.NoteRemoteObject.CommonQuery(string.Concat(new string[]
						{
							"exec usp_wn_querywjwshnote '",
							sBeginDate,
							"','",
							aEndDate,
							"',0,",
							iGetFlag.ToString(),
							",'",
							this._LoginInfo.LoginID,
							"'"
						}), ref array, ref text);
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				if (flag)
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					result = num;
				}
				else
				{
					result = 0;
				}
			}
			return result;
		}
		private void mmNewUser_Click(object sender, EventArgs e)
		{
			if (!this.Connected)
			{
				this.mmConnect_Click(null, null);
			}
			if (!this.Connected)
			{
				MessageBox.Show("服务器未连接，无法使用新用户注册服务！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				new FrmNewUser
				{
					NoteRemoteObject = this.NoteRemoteObject
				}.ShowDialog();
			}
		}
		private void mmEditNote_Click(object sender, EventArgs e)
		{
			this.objFrmEditNote = new FrmEditNote();
			this.objFrmEditNote.EditMode = FrmEditNote.TEditMode.NewNote;
			string str = "";
			switch (DateTime.Now.DayOfWeek)
			{
			case DayOfWeek.Sunday:
				str = "星期日";
				break;
			case DayOfWeek.Monday:
				str = "星期一";
				break;
			case DayOfWeek.Tuesday:
				str = "星期二";
				break;
			case DayOfWeek.Wednesday:
				str = "星期三";
				break;
			case DayOfWeek.Thursday:
				str = "星期四";
				break;
			case DayOfWeek.Friday:
				str = "星期五";
				break;
			case DayOfWeek.Saturday:
				str = "星期六";
				break;
			}
			this.objFrmEditNote.groupBoxMain.Text = "日志编辑器 - 今天是" + DateTime.Now.ToString("yyyy年MM月dd号、") + str;
			this.objFrmEditNote.NoteRemoteObject = this.NoteRemoteObject;
			this.objFrmEditNote.LoginInfo = this._LoginInfo;
			if (this.treeViewNote.SelectedNode != null)
			{
				if (this.treeViewNote.SelectedNode.Level == 2)
				{
					this.objFrmEditNote.CurrentDate = this.treeViewNote.SelectedNode.Parent.Text + "-" + this.treeViewNote.SelectedNode.Text.Substring(0, 2);
				}
				if (this.treeViewNote.SelectedNode.Level == 3)
				{
					this.objFrmEditNote.CurrentDate = this.treeViewNote.SelectedNode.Parent.Parent.Text + "-" + this.treeViewNote.SelectedNode.Parent.Text.Substring(0, 2);
				}
			}
			else
			{
				this.objFrmEditNote.CurrentDate = "";
			}
			this.objFrmEditNote.objNoteClientCtl = this;
			this.b_IsFreeMode = false;
			this.SetMemuEnabled();
			this.objFrmEditNote.Show();
		}
		public void EditNoteCallBack(bool bNeedRefresh, string aLastNewNoteID, bool bIsFreeMode)
		{
			this.b_IsFreeMode = bIsFreeMode;
			this.LastNewNoteID = aLastNewNoteID;
			this.SetMemuEnabled();
			if (bNeedRefresh)
			{
				this.Refresh();
				this.mmRefresh_Click(null, null);
			}
		}
		private void mmRefresh_Click(object sender, EventArgs e)
		{
			this.GetNoteListAndFillTreeView();
			bool flag = false;
			while (!flag)
			{
				flag = true;
				Application.DoEvents();
				for (int i = 0; i < this.ThreadAllDone.Length; i++)
				{
					if (!this.ThreadAllDone[i])
					{
						flag = false;
						break;
					}
				}
			}
			if (flag)
			{
				if (this.LastNewNoteID.Trim() == "")
				{
					this.timLocateToday.Enabled = true;
				}
				if (this.LastNewNoteID.Trim() != "")
				{
					this.timLocateLastEditNote.Enabled = true;
				}
				if (this.b_FirstShow)
				{
					this.b_FirstShow = false;
					this.timQueryWjwsh.Enabled = true;
				}
			}
		}
		private void mmAlterPwd_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			new FrmAlterPwd
			{
				NoteRemoteObject = this.NoteRemoteObject,
				LoginInfo = this._LoginInfo
			}.ShowDialog();
		}
		private void mmDeleteNote_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			if (this.treeViewNote.SelectedNode != null)
			{
				TAGDATA tAGDATA = new TAGDATA();
				tAGDATA = (TAGDATA)this.treeViewNote.SelectedNode.Tag;
				if (tAGDATA.CanDelete)
				{
					if (MessageBox.Show("是否确定删除选定的日志？", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) != DialogResult.No)
					{
						string str = "";
						bool flag = false;
						try
						{
							flag = this.NoteRemoteObject.DeleteNote(tAGDATA.NoteID, ref str);
						}
						catch (Exception ex)
						{
							MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
						if (flag)
						{
							TreeNode treeNode = new TreeNode();
							TreeNode treeNode2 = new TreeNode();
							treeNode = this.treeViewNote.SelectedNode;
							treeNode2 = this.treeViewNote.SelectedNode.Parent;
							int num = treeNode.Text.IndexOf(":");
							int num2 = treeNode.Text.IndexOf(",");
							string value = treeNode.Text.Substring(num + 1, num2 - num - 1);
							num = treeNode.Parent.Text.IndexOf(":");
							string str2 = treeNode.Parent.Text.Substring(0, num + 1);
							string value2 = treeNode.Parent.Text.Substring(num + 1, treeNode.Parent.Text.Length - num - 1);
							treeNode.Remove();
							this.DeleteLocalNote(tAGDATA.NoteDate, ref str);
							if (Convert.ToDecimal(value) == Convert.ToDecimal(value2))
							{
								treeNode2.Remove();
							}
							else
							{
								treeNode2.Text = str2 + (Convert.ToDecimal(value2) - Convert.ToDecimal(value)).ToString();
							}
							MessageBox.Show("日志删除成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
						else
						{
							MessageBox.Show("日志删除失败！" + str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
					}
				}
			}
		}
		private bool DeleteLocalNote(string aNoteDate, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "删除本地缓存日志失败！本地数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from [NoteList] where [NoteDate]='" + aNoteDate.Trim() + "'";
				int num = localAccess.ExecSQL(aStrSql);
				if (num != 1)
				{
					aErrMsg = localAccess.Message;
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = true;
				}
			}
			return result;
		}
		private void mmTask_DropDownOpening(object sender, EventArgs e)
		{
			if (this.treeViewNote.SelectedNode == null)
			{
				this.mmDeleteNote.Enabled = false;
				this.mmViewNoteInfo.Enabled = false;
			}
			else
			{
				TAGDATA tAGDATA = new TAGDATA();
				tAGDATA = (TAGDATA)this.treeViewNote.SelectedNode.Tag;
				this.mmAlterNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && tAGDATA.CanEdit && this.b_IsFreeMode);
				this.mmDeleteNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && tAGDATA.CanDelete && this.b_IsFreeMode);
				this.mmViewNoteInfo.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && tAGDATA.CanShowNoteInfo && this.b_IsFreeMode);
			}
		}
		private void mmNoteCheck_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmNoteCheck frmNoteCheck = new FrmNoteCheck();
			frmNoteCheck.LoginInfo = this._LoginInfo;
			frmNoteCheck.NoteRemoteObject = this.NoteRemoteObject;
			frmNoteCheck.ShowDialog();
			frmNoteCheck.Dispose();
		}
		private void mmPurviewMange_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmPurviewMange frmPurviewMange = new FrmPurviewMange();
			frmPurviewMange.LoginInfo = this._LoginInfo;
			frmPurviewMange.NoteRemoteObject = this.NoteRemoteObject;
			frmPurviewMange.ShowDialog();
			frmPurviewMange.Dispose();
		}
		private void mmUpLoadNote_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmUploadLocalNote frmUploadLocalNote = new FrmUploadLocalNote();
			frmUploadLocalNote.LoginInfo = this._LoginInfo;
			frmUploadLocalNote.NoteRemoteObject = this.NoteRemoteObject;
			frmUploadLocalNote.ShowDialog();
			bool needRefresh = frmUploadLocalNote.NeedRefresh;
			frmUploadLocalNote.Dispose();
			if (needRefresh)
			{
				this.Refresh();
				this.mmRefresh_Click(null, null);
			}
		}
		private void mmViewNoteInfo_Click(object sender, EventArgs e)
		{
			if (this.treeViewNote.SelectedNode != null)
			{
				TAGDATA tAGDATA = (TAGDATA)this.treeViewNote.SelectedNode.Tag;
				if (tAGDATA.CanShowNoteInfo)
				{
					try
					{
						if (!this.NoteRemoteObject.ConnectionTest())
						{
							MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							this.StateReset();
							return;
						}
					}
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						this.StateReset();
						return;
					}
					FrmNoteInfo frmNoteInfo = new FrmNoteInfo();
					frmNoteInfo.NoteID = tAGDATA.NoteID;
					frmNoteInfo.LoginInfo = this._LoginInfo;
					frmNoteInfo.NoteRemoteObject = this.NoteRemoteObject;
					frmNoteInfo.ShowDialog();
					frmNoteInfo.Dispose();
				}
			}
		}
		private void mmLogout_Click(object sender, EventArgs e)
		{
			if (MessageBox.Show("确定要" + this.mmLogout.Text + "吗？", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
			{
				this.StateReset();
			}
		}
		private void pmEditNote_Click(object sender, EventArgs e)
		{
			this.mmEditNote_Click(null, null);
		}
		private void pmDeleteNote_Click(object sender, EventArgs e)
		{
			this.mmDeleteNote_Click(null, null);
		}
		private void pmUpLoadNote_Click(object sender, EventArgs e)
		{
			this.mmUpLoadNote_Click(null, null);
		}
		private void pmViewNoteInfo_Click(object sender, EventArgs e)
		{
			this.mmViewNoteInfo_Click(null, null);
		}
		private void pmRefresh_Click(object sender, EventArgs e)
		{
			this.mmRefresh_Click(null, null);
		}
		private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
		{
			if (this.treeViewNote.SelectedNode == null)
			{
				this.pmDeleteNote.Enabled = false;
				this.pmViewNoteInfo.Enabled = false;
			}
			else
			{
				TAGDATA tAGDATA = new TAGDATA();
				tAGDATA = (TAGDATA)this.treeViewNote.SelectedNode.Tag;
				this.pmEditNote.Enabled = this.b_IsFreeMode;
				this.pmAlterNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && tAGDATA.CanEdit && this.b_IsFreeMode);
				this.pmDeleteNote.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && tAGDATA.CanDelete && this.b_IsFreeMode);
				this.pmViewNoteInfo.Enabled = (this.Connected && this._LoginInfo.LoginSuccess && tAGDATA.CanShowNoteInfo && this.b_IsFreeMode);
			}
		}
		private void treeViewNote_DoubleClick(object sender, EventArgs e)
		{
			this.mmViewNoteInfo_Click(null, null);
		}
		private void mmAlterNote_Click(object sender, EventArgs e)
		{
			if (this.treeViewNote.SelectedNode != null)
			{
				TAGDATA tAGDATA = (TAGDATA)this.treeViewNote.SelectedNode.Tag;
				if (tAGDATA.CanEdit)
				{
					this.objFrmEditNote = new FrmEditNote();
					this.objFrmEditNote.EditMode = FrmEditNote.TEditMode.AlterNote;
					string str = "";
					switch (DateTime.Now.DayOfWeek)
					{
					case DayOfWeek.Sunday:
						str = "星期日";
						break;
					case DayOfWeek.Monday:
						str = "星期一";
						break;
					case DayOfWeek.Tuesday:
						str = "星期二";
						break;
					case DayOfWeek.Wednesday:
						str = "星期三";
						break;
					case DayOfWeek.Thursday:
						str = "星期四";
						break;
					case DayOfWeek.Friday:
						str = "星期五";
						break;
					case DayOfWeek.Saturday:
						str = "星期六";
						break;
					}
					this.objFrmEditNote.groupBoxMain.Text = "日志编辑器 - 今天是" + DateTime.Now.ToString("yyyy年MM月dd号、") + str;
					this.objFrmEditNote.NoteRemoteObject = this.NoteRemoteObject;
					this.objFrmEditNote.LoginInfo = this._LoginInfo;
					this.objFrmEditNote.GetNoteInfo(tAGDATA.NoteID);
					this.objFrmEditNote.objNoteClientCtl = this;
					this.b_IsFreeMode = false;
					this.SetMemuEnabled();
					this.objFrmEditNote.Show();
				}
			}
		}
		private void pmAlterNote_Click(object sender, EventArgs e)
		{
			this.mmAlterNote_Click(null, null);
		}
		private void treeViewNote_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Delete)
			{
				this.mmDeleteNote_Click(null, null);
			}
		}
		private void mmDepData_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmSysBasicData frmSysBasicData = new FrmSysBasicData();
			frmSysBasicData.NoteRemoteObject = this.NoteRemoteObject;
			frmSysBasicData.ShowDialog();
			frmSysBasicData.Dispose();
		}
		private void mmQueryUserPwd_Click(object sender, EventArgs e)
		{
			string aUserID = "";
			FrmGetUserInput frmGetUserInput = new FrmGetUserInput();
			frmGetUserInput.Text = "清空密码";
			frmGetUserInput.lbMsg.Text = "请输入需要清空密码的用户ID";
			if (frmGetUserInput.ShowDialog() == DialogResult.OK)
			{
				aUserID = frmGetUserInput.tboxValue.Text.Trim();
				frmGetUserInput.Dispose();
				try
				{
					if (!this.NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						this.StateReset();
						return;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
				string text = "";
				bool flag = false;
				try
				{
					flag = this.NoteRemoteObject.ClearUserPwd(aUserID, ref text);
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
				if (flag)
				{
					MessageBox.Show("用户密码清空成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				else
				{
					MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
			}
			else
			{
				frmGetUserInput.Dispose();
			}
		}
		private void ReadClientConfig()
		{
			try
			{
				RegistryKey localMachine = Registry.LocalMachine;
				RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
				object value = registryKey.GetValue("NoteLoadMonths");
				if (value == null)
				{
					NoteClientCtl.iMonths = 6;
				}
				else
				{
					NoteClientCtl.iMonths = Convert.ToInt32(value);
				}
				value = registryKey.GetValue("NoteTopicDisplayChars");
				if (value == null)
				{
					NoteClientCtl.iTopChars = 10;
				}
				else
				{
					NoteClientCtl.iTopChars = Convert.ToInt32(value);
				}
			}
			catch
			{
			}
		}
		private void mmClientConfig_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmClientConfig frmClientConfig = new FrmClientConfig();
			frmClientConfig.NoteRemoteObject = this.NoteRemoteObject;
			frmClientConfig.LoginInfo = this._LoginInfo;
			bool flag = frmClientConfig.ShowDialog() == DialogResult.OK;
			frmClientConfig.Dispose();
			if (flag)
			{
				this.GetNoteListAndFillTreeView();
			}
		}
		private void mmWorkLoadAudit_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmWorkLoadAudit frmWorkLoadAudit = new FrmWorkLoadAudit();
			frmWorkLoadAudit.LoginInfo = this._LoginInfo;
			frmWorkLoadAudit.NoteRemoteObject = this.NoteRemoteObject;
			frmWorkLoadAudit.ShowDialog();
			frmWorkLoadAudit.Dispose();
		}
		private void mmDownLoadNote_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			new FrmDownLoadNote
			{
				NoteRemoteObject = this.NoteRemoteObject,
				LoginInfo = this._LoginInfo
			}.ShowDialog();
		}
		private void mmNoteQuery_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmNoteQuery frmNoteQuery = new FrmNoteQuery();
			frmNoteQuery.LoginInfo = this._LoginInfo;
			frmNoteQuery.NoteRemoteObject = this.NoteRemoteObject;
			frmNoteQuery.ShowDialog();
			frmNoteQuery.Dispose();
		}
		private string GetNoteClientStartPath()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("NoteClientStartPath");
			string result;
			if (value == null)
			{
				result = "";
			}
			else
			{
				result = value.ToString();
			}
			return result;
		}
		private bool QueryNotUpLoadNote()
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(this.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "select [NoteTopic],[NoteBody],[NoteDate],[WorkLoad],[CreateDate],[CreateTime],[BeginTime],[EndTime],[NoteIndex] from [NoteList] where UploadFlag = 0";
				array = localAccess.Open(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private bool LocalHasNotes()
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(this.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "select [NoteTopic],[NoteBody],[NoteDate],[WorkLoad],[CreateDate],[CreateTime],[BeginTime],[EndTime],[NoteIndex] from [NoteList]";
				array = localAccess.Open(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private bool ClearLocalNote()
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(this.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from [NoteList]";
				int num = localAccess.ExecSQL(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private bool SaveAsLocalNote(string aNoteTopic, string aNoteBody, string aNoteDate, string aWorkLoad, string aUploadFlag, string aBeginTime, string aEndTime, string aCreateDate, string aCreateTime, string aTaskID, string aAddress, string aHospital, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "保存日志至本地缓存表失败！本地数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				if (aNoteTopic.Trim() == "")
				{
					aErrMsg = "保存日志至本地缓存表失败！日志主题不能为空！";
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					if (aNoteBody.Trim() == "")
					{
						aErrMsg = "保存日志至本地缓存表失败！日志正文不能为空！";
						localAccess.DisConnect();
						GC.Collect();
						result = false;
					}
					else
					{
						if (aNoteDate.Trim() == "")
						{
							aErrMsg = "保存日志至本地缓存表失败！日志日期不能为空！";
							localAccess.DisConnect();
							GC.Collect();
							result = false;
						}
						else
						{
							string aStrSql = string.Concat(new string[]
							{
								"insert into [NoteList]([NoteTopic],[NoteBody],[NoteDate],[WorkLoad],[CreateDate],[CreateTime],[UploadFlag],[BeginTime],[EndTime],[TaskID],[Address],[Hospital]) values('",
								aNoteTopic,
								"','",
								aNoteBody,
								"','",
								aNoteDate,
								"',",
								aWorkLoad,
								",'",
								aCreateDate,
								"','",
								aCreateTime,
								"',",
								aUploadFlag,
								",'",
								aBeginTime,
								"','",
								aEndTime,
								"','",
								aTaskID,
								"','",
								aAddress,
								"','",
								aHospital,
								"')"
							});
							int num = localAccess.ExecSQL(aStrSql);
							if (num != 1)
							{
								aErrMsg = localAccess.Message;
								localAccess.DisConnect();
								GC.Collect();
								result = false;
							}
							else
							{
								localAccess.DisConnect();
								GC.Collect();
								result = true;
							}
						}
					}
				}
			}
			return result;
		}
		private void mmSynchronous_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			if (this.QueryNotUpLoadNote())
			{
				MessageBox.Show("本地有日志未上传到服务器，请先使用“上传本地日志”模块上传本地日志，然后再重试同步日志！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				bool flag = this.LocalHasNotes();
				if (flag)
				{
					if (MessageBox.Show("同步日志开始之前将清空本地日志库，是否继续？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
					{
						return;
					}
				}
				FrmSynProgress frmSynProgress = new FrmSynProgress();
				frmSynProgress.Show();
				frmSynProgress.SetProgress(0, 0, "正在删除本地日志.......");
				frmSynProgress.Refresh();
				this.ClearLocalNote();
				string aStrSql = "select NoteDate,NoteTopic,NoteBody,convert(varchar,WorkLoad),BeginTime,EndTime,CreateDate,CreateTime,TaskID,Address,Hospital from WorkNotes where EmpID='" + this._LoginInfo.LoginID + "'";
				string[,] array = new string[0, 0];
				string str = "";
				frmSynProgress.SetProgress(0, 0, "正在从服务器获取日志数据.......");
				frmSynProgress.Refresh();
				string text = "";
				bool flag2 = this.NoteRemoteObject.CommonQuery(aStrSql, ref array, ref str);
				if (flag2)
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					frmSynProgress.SetProgress(0, num, "");
					for (int i = 0; i < num; i++)
					{
						Application.DoEvents();
						if (num <= 250)
						{
							Thread.Sleep(0);
						}
						else
						{
							if (num > 250 && num <= 500)
							{
								Thread.Sleep(0);
							}
							else
							{
								if (num > 500 && num <= 1000)
								{
									Thread.Sleep(0);
								}
								else
								{
									if (num > 1000 && num <= 2000)
									{
										Thread.Sleep(0);
									}
									else
									{
										if (num > 2000 && num <= 4000)
										{
											Thread.Sleep(0);
										}
										else
										{
											if (num > 4000)
											{
												Thread.Sleep(0);
											}
										}
									}
								}
							}
						}
						if ((i + 1) % 5 == 1)
						{
							text = ">";
						}
						if ((i + 1) % 5 == 2)
						{
							text = ">>";
						}
						if ((i + 1) % 5 == 3)
						{
							text = ">>>";
						}
						if ((i + 1) % 5 == 4)
						{
							text = ">>>>";
						}
						if ((i + 1) % 5 == 0)
						{
							text = ">>>>>";
						}
						frmSynProgress.SetValue(i, string.Concat(new string[]
						{
							"正在同步 ",
							text,
							" ",
							array[i, 0],
							" ",
							array[i, 1]
						}));
						string text2 = "";
						if (!this.SaveAsLocalNote(array[i, 1], array[i, 2], array[i, 0], array[i, 3], "1", array[i, 4], array[i, 5], array[i, 6], array[i, 7], array[i, 8], array[i, 9], array[i, 10], ref text2))
						{
							MessageBox.Show(text2, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
					}
					frmSynProgress.Dispose();
					if (flag)
					{
						MessageBox.Show("同步成功完成！本次同步了 " + num.ToString() + " 条日志明细！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
				}
				else
				{
					frmSynProgress.Dispose();
					MessageBox.Show("日志数据获取失败！错误：" + str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
			}
		}
		private void timwait_Tick(object sender, EventArgs e)
		{
			this.timLocateToday.Enabled = false;
			TreeNode treeNode = new TreeNode();
			treeNode = this.treeViewNote.Nodes[0];
			for (int i = 0; i < treeNode.Nodes.Count; i++)
			{
				TreeNode treeNode2 = new TreeNode();
				treeNode2 = treeNode.Nodes[i];
				for (int j = 0; j < treeNode2.Nodes.Count; j++)
				{
					TreeNode treeNode3 = new TreeNode();
					treeNode3 = treeNode2.Nodes[j];
					if (treeNode2.Text + "-" + treeNode3.Text.Substring(0, 2) == DateTime.Now.ToString("yyyy-MM-dd"))
					{
						this.treeViewNote.SelectedNode = treeNode3;
						treeNode3.ExpandAll();
						this.treeViewNote.Focus();
						break;
					}
				}
			}
		}
		private void mmSendMsg_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			new FrmSendMsg
			{
				NoteRemoteObject = this.NoteRemoteObject,
				LoginInfo = this._LoginInfo
			}.ShowDialog();
		}
		private void pmNoteQuery_Click(object sender, EventArgs e)
		{
			this.mmNoteQuery_Click(sender, e);
		}
		private void pmSynchronous_Click(object sender, EventArgs e)
		{
			this.mmSynchronous_Click(sender, e);
		}
		private void treeViewNote_ItemDrag(object sender, ItemDragEventArgs e)
		{
			TreeNode treeNode = e.Item as TreeNode;
			if (e.Button == MouseButtons.Left && treeNode != null && treeNode.Level == 3)
			{
				TAGDATA tAGDATA = new TAGDATA();
				tAGDATA = (TAGDATA)treeNode.Tag;
				if (tAGDATA.CanDelete && tAGDATA.CanEdit)
				{
					this.treeViewNote.DoDragDrop(treeNode, DragDropEffects.Copy | DragDropEffects.Move | DragDropEffects.Link);
				}
			}
		}
		private void treeViewNote_DragEnter(object sender, DragEventArgs e)
		{
			if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode"))
			{
				e.Effect = DragDropEffects.Move;
			}
			else
			{
				e.Effect = DragDropEffects.None;
			}
		}
		private void treeViewNote_DragDrop(object sender, DragEventArgs e)
		{
			if (e.Data.GetDataPresent(typeof(TreeNode)))
			{
				System.Drawing.Point pt = ((TreeView)sender).PointToClient(new System.Drawing.Point(e.X, e.Y));
				TreeNode nodeAt = ((TreeView)sender).GetNodeAt(pt);
				if (nodeAt.Level == 2)
				{
					TreeNode treeNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");
					if (treeNode.Parent != nodeAt)
					{
						if (MessageBox.Show(string.Concat(new string[]
						{
							"是否要把<",
							treeNode.Text,
							">移动到<",
							nodeAt.Text,
							">下？"
						}), "请确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.No)
						{
							TreeNode treeNode2 = (TreeNode)treeNode.Clone();
							TAGDATA tAGDATA = new TAGDATA();
							tAGDATA = (TAGDATA)treeNode.Tag;
							string noteID = tAGDATA.NoteID;
							string noteDate = tAGDATA.NoteDate;
							string text = nodeAt.Parent.Text + "-" + nodeAt.Text.Substring(0, 2);
							try
							{
								if (!this.NoteRemoteObject.ConnectionTest())
								{
									MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
									this.StateReset();
									return;
								}
							}
							catch (Exception ex)
							{
								MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								this.StateReset();
								return;
							}
							string[,] array = new string[0, 0];
							string text2 = "";
							bool flag = this.NoteRemoteObject.CommonQuery(string.Concat(new string[]
							{
								"exec usp_wn_notechange '",
								noteID,
								"','",
								noteDate,
								"','",
								text,
								"'"
							}), ref array, ref text2);
							if (text2.Trim() != "")
							{
								MessageBox.Show("日志移动失败！" + text2, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							}
							else
							{
								if (array[0, 0] == "T")
								{
									string noteDate2 = nodeAt.Parent.Text + "-" + nodeAt.Text.Substring(0, 2);
									int num = nodeAt.Text.IndexOf(":");
									string str = nodeAt.Text.Substring(0, num + 1);
									string value = nodeAt.Text.Substring(num + 1, nodeAt.Text.Length - num - 1);
									num = treeNode.Text.IndexOf(":");
									int num2 = treeNode.Text.IndexOf(",");
									string value2 = treeNode.Text.Substring(num + 1, num2 - num - 1);
									num = treeNode.Parent.Text.IndexOf(":");
									string str2 = treeNode.Parent.Text.Substring(0, num + 1);
									string value3 = treeNode.Parent.Text.Substring(num + 1, treeNode.Parent.Text.Length - num - 1);
									nodeAt.Text = str + (Convert.ToDecimal(value) + Convert.ToDecimal(value2)).ToString();
									treeNode.Parent.Text = str2 + (Convert.ToDecimal(value3) - Convert.ToDecimal(value2)).ToString();
									tAGDATA.NoteDate = noteDate2;
									treeNode2.Tag = tAGDATA;
									nodeAt.Nodes.Add(treeNode2);
									nodeAt.Expand();
									this.treeViewNote.SelectedNode = treeNode2;
									treeNode.Remove();
								}
								else
								{
									MessageBox.Show(array[0, 1], "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								}
							}
						}
					}
				}
			}
		}
		private void timLocate_Tick(object sender, EventArgs e)
		{
			this.timLocateLastEditNote.Enabled = false;
			TreeNode treeNode = new TreeNode();
			treeNode = this.treeViewNote.Nodes[0];
			for (int i = 0; i < treeNode.Nodes.Count; i++)
			{
				TreeNode treeNode2 = new TreeNode();
				treeNode2 = treeNode.Nodes[i];
				for (int j = 0; j < treeNode2.Nodes.Count; j++)
				{
					TreeNode treeNode3 = new TreeNode();
					treeNode3 = treeNode2.Nodes[j];
					for (int k = 0; k < treeNode3.Nodes.Count; k++)
					{
						TAGDATA tAGDATA = new TAGDATA();
						tAGDATA = (TAGDATA)treeNode3.Nodes[k].Tag;
						if (tAGDATA.NoteID == this.LastNewNoteID)
						{
							this.treeViewNote.SelectedNode = treeNode3.Nodes[k];
							this.LastNewNoteID = "";
							this.treeViewNote.Focus();
							break;
						}
					}
				}
			}
		}
		private void treeViewNote_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
		{
			if (e.Node.Level == 0 || e.Node.Level == 1 || e.Node.Level == 2)
			{
				e.Node.ImageIndex = 0;
			}
		}
		private void treeViewNote_BeforeExpand(object sender, TreeViewCancelEventArgs e)
		{
			if (e.Node.Level == 0 || e.Node.Level == 1 || e.Node.Level == 2)
			{
				e.Node.ImageIndex = 22;
			}
		}
		private void mmViewWjwshrz_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmViewWjwsh frmViewWjwsh = new FrmViewWjwsh();
			frmViewWjwsh.LoginInfo = this._LoginInfo;
			frmViewWjwsh.NoteRemoteObject = this.NoteRemoteObject;
			frmViewWjwsh.ShowDialog();
			frmViewWjwsh.Dispose();
		}
		private string GetAlarmType()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("AlarmType");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "7";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private string GetAlarmBeginDate()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("AlarmBeginDate");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "2009-02-09";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private void timQueryWjwsh_Tick(object sender, EventArgs e)
		{
			this.timQueryWjwsh.Enabled = false;
			string alarmType = this.GetAlarmType();
			if (!(alarmType == "0"))
			{
				if (!(alarmType == "2"))
				{
					if (!(alarmType == "3"))
					{
						if (!(alarmType == "6"))
						{
							if (this._LoginInfo.LoginSuccess)
							{
								int noteInfos = this.GetNoteInfos(this.GetAlarmBeginDate(), DateTime.Now.AddDays(-this.GetAlarm0()).ToString("yyyy-MM-dd"), 0);
								int noteInfos2 = this.GetNoteInfos(this.GetAlarmBeginDate(), DateTime.Now.AddDays(-this.GetAlarm1()).ToString("yyyy-MM-dd"), 1);
								if (noteInfos != 0 || noteInfos2 != 0)
								{
									if (noteInfos != 0 && noteInfos2 == 0)
									{
										if (new FrmNoteAlarm
										{
											NoteRemoteObject = this.NoteRemoteObject,
											LoginInfo = this._LoginInfo,
											lbMsg = 
											{
												Text = "您有 " + noteInfos.ToString() + " 天日志没有交，请抓紧时间补交！"
											}
										}.ShowDialog() == DialogResult.Cancel)
										{
											return;
										}
									}
									if (noteInfos == 0 && noteInfos2 != 0)
									{
										if (new FrmNoteAlarm
										{
											NoteRemoteObject = this.NoteRemoteObject,
											LoginInfo = this._LoginInfo,
											lbMsg = 
											{
												Text = "您有 " + noteInfos2.ToString() + " 个日志明细没有审核，请抓紧时间审核！"
											}
										}.ShowDialog() == DialogResult.Cancel)
										{
											return;
										}
									}
									if (noteInfos != 0 && noteInfos2 != 0)
									{
										if (new FrmNoteAlarm
										{
											NoteRemoteObject = this.NoteRemoteObject,
											LoginInfo = this._LoginInfo,
											lbMsg = 
											{
												Text = string.Concat(new string[]
												{
													"您有 ",
													noteInfos.ToString(),
													" 天日志没有交、有 ",
													noteInfos2.ToString(),
													" 个日志明细没有审核！"
												})
											}
										}.ShowDialog() == DialogResult.Cancel)
										{
											return;
										}
									}
									this.mmViewWjwshrz_Click(sender, e);
								}
							}
						}
					}
				}
			}
		}
		private bool ClearLocalExpandFieldType()
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from [ExpandFieldType]";
				int num = localAccess.ExecSQL(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private bool ClearLocalExpandFieldDefine()
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from [ExpandFieldDefine]";
				int num = localAccess.ExecSQL(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private bool SaveRemoteExpandFieldTypeToLocalMdb()
		{
			bool result;
			if (!this._LoginInfo.LoginSuccess)
			{
				result = false;
			}
			else
			{
				string text = "";
				LocalAccess localAccess = new LocalAccess();
				localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
				if (!localAccess.Connected)
				{
					text = "保存失败！本地数据库连接失败！";
					GC.Collect();
					result = false;
				}
				else
				{
					string[,] array = new string[0, 0];
					bool flag = this.NoteRemoteObject.CommonQuery("select TypeID,TypeName from ExpandFieldType(nolock)", ref array, ref text);
					if (flag)
					{
						this.ClearLocalExpandFieldType();
						int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
						int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
						for (int i = 0; i < num; i++)
						{
							string text2 = array[i, 0];
							string text3 = array[i, 1];
							string aStrSql = string.Concat(new string[]
							{
								"insert into [ExpandFieldType]([TypeID],[TypeName]) values(",
								text2,
								",'",
								text3,
								"')"
							});
							int num3 = localAccess.ExecSQL(aStrSql);
							if (num3 != 1)
							{
								text = localAccess.Message;
								localAccess.DisConnect();
								GC.Collect();
								result = false;
								return result;
							}
						}
					}
					localAccess.DisConnect();
					GC.Collect();
					result = true;
				}
			}
			return result;
		}
		private bool SaveRemoteExpandFieldDefineToLocalMdb()
		{
			bool result;
			if (!this._LoginInfo.LoginSuccess)
			{
				result = false;
			}
			else
			{
				string text = "";
				LocalAccess localAccess = new LocalAccess();
				localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
				if (!localAccess.Connected)
				{
					text = "保存失败！本地数据库连接失败！";
					GC.Collect();
					result = false;
				}
				else
				{
					string[,] array = new string[0, 0];
					bool flag = this.NoteRemoteObject.CommonQuery("select FieldCode,TaskID,FieldName,FieldType,NullAble from ExpandFieldDefine(nolock)", ref array, ref text);
					if (flag)
					{
						this.ClearLocalExpandFieldDefine();
						int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
						int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
						for (int i = 0; i < num; i++)
						{
							string text2 = array[i, 0];
							string text3 = array[i, 1];
							string text4 = array[i, 2];
							string text5 = array[i, 3];
							string text6 = array[i, 4];
							string aStrSql = string.Concat(new string[]
							{
								"insert into [ExpandFieldDefine]([FieldCode],[TaskID],[FieldName],[FieldType],[NullAble]) values(",
								text2,
								",",
								text3,
								",'",
								text4,
								"',",
								text5,
								",",
								text6,
								")"
							});
							int num3 = localAccess.ExecSQL(aStrSql);
							if (num3 != 1)
							{
								text = localAccess.Message;
								localAccess.DisConnect();
								GC.Collect();
								result = false;
								return result;
							}
						}
					}
					localAccess.DisConnect();
					GC.Collect();
					result = true;
				}
			}
			return result;
		}
		private void treeViewNote_MouseEnter(object sender, EventArgs e)
		{
			if (this.objFrmEditNote != null)
			{
				if (this.objFrmEditNote.Visible)
				{
					this.objFrmEditNote.BringToFront();
					this.objFrmEditNote.ShowEditNoteForm();
				}
			}
		}
		private void mmWeekMonthSchedule_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			new FrmMonthWeekSchedule
			{
				NoteRemoteObject = this.NoteRemoteObject,
				LoginInfo = this._LoginInfo
			}.ShowDialog();
		}
		private void mmGroupCom_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmDepCommunicationBook frmDepCommunicationBook = new FrmDepCommunicationBook();
			frmDepCommunicationBook.LoginInfo = this._LoginInfo;
			frmDepCommunicationBook.NoteRemoteObject = this.NoteRemoteObject;
			frmDepCommunicationBook.ShowDialog();
			frmDepCommunicationBook.Dispose();
		}
		private void mmBug_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmBugReport frmBugReport = new FrmBugReport();
			frmBugReport.LoginInfo = this._LoginInfo;
			frmBugReport.NoteRemoteObject = this.NoteRemoteObject;
			frmBugReport.ShowDialog();
			frmBugReport.Dispose();
		}
		private void mmHelpCenter_Click(object sender, EventArgs e)
		{
			Help.ShowHelp(new Control(), NoteRemote.GetNoteClientStartPath() + "\\日志管理系统帮助文件.chm", "欢迎.htm");
		}
		private void mmjkgzlMgr_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this.NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.StateReset();
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.StateReset();
				return;
			}
			FrmYbjkWorkLoad frmYbjkWorkLoad = new FrmYbjkWorkLoad();
			frmYbjkWorkLoad.LoginInfo = this._LoginInfo;
			frmYbjkWorkLoad.NoteRemoteObject = this.NoteRemoteObject;
			frmYbjkWorkLoad.ShowDialog();
			frmYbjkWorkLoad.Dispose();
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(NoteClientCtl));
			this.imageList = new ImageList(this.components);
			this.menuStrip = new MenuStrip();
			this.mmFile = new ToolStripMenuItem();
			this.mmConnect = new ToolStripMenuItem();
			this.mmLogin = new ToolStripMenuItem();
			this.mmLogout = new ToolStripMenuItem();
			this.toolStripSeparator2 = new ToolStripSeparator();
			this.mmAlterPwd = new ToolStripMenuItem();
			this.mmNewUser = new ToolStripMenuItem();
			this.toolStripSeparator9 = new ToolStripSeparator();
			this.mmClientConfig = new ToolStripMenuItem();
			this.toolStripSeparator3 = new ToolStripSeparator();
			this.mmRefresh = new ToolStripMenuItem();
			this.mmSelfTask = new ToolStripMenuItem();
			this.mmEditNote = new ToolStripMenuItem();
			this.mmDeleteNote = new ToolStripMenuItem();
			this.mmAlterNote = new ToolStripMenuItem();
			this.toolStripSeparator8 = new ToolStripSeparator();
			this.mmSynchronous = new ToolStripMenuItem();
			this.mmDownLoadNote = new ToolStripMenuItem();
			this.mmUpLoadNote = new ToolStripMenuItem();
			this.toolStripSeparator1 = new ToolStripSeparator();
			this.mmNoteQuery = new ToolStripMenuItem();
			this.mmViewWjwshrz = new ToolStripMenuItem();
			this.mmViewNoteInfo = new ToolStripMenuItem();
			this.toolStripMenuItem1 = new ToolStripSeparator();
			this.mmSendMsg = new ToolStripMenuItem();
			this.toolStripMenuItem2 = new ToolStripSeparator();
			this.mmWeekMonthSchedule = new ToolStripMenuItem();
			this.toolStripMenuItem3 = new ToolStripSeparator();
			this.mmDepCommunicationBook = new ToolStripMenuItem();
			this.toolStripMenuItem4 = new ToolStripSeparator();
			this.mmjkgzlMgr = new ToolStripMenuItem();
			this.mmMangerTask = new ToolStripMenuItem();
			this.mmNoteCheck = new ToolStripMenuItem();
			this.mmWorkLoadAuditQuery = new ToolStripMenuItem();
			this.toolStripSeparator6 = new ToolStripSeparator();
			this.mmSysBasicData = new ToolStripMenuItem();
			this.mmPurviewMange = new ToolStripMenuItem();
			this.toolStripSeparator7 = new ToolStripSeparator();
			this.mmClearUserPwd = new ToolStripMenuItem();
			this.mmHelp = new ToolStripMenuItem();
			this.mmBug = new ToolStripMenuItem();
			this.mmHelpCenter = new ToolStripMenuItem();
			this.treeViewNote = new TreeView();
			this.contextMenuStrip = new ContextMenuStrip(this.components);
			this.pmEditNote = new ToolStripMenuItem();
			this.pmDeleteNote = new ToolStripMenuItem();
			this.pmAlterNote = new ToolStripMenuItem();
			this.toolStripSeparator10 = new ToolStripSeparator();
			this.pmSynchronous = new ToolStripMenuItem();
			this.pmUpLoadNote = new ToolStripMenuItem();
			this.toolStripSeparator4 = new ToolStripSeparator();
			this.pmRefresh = new ToolStripMenuItem();
			this.toolStripSeparator5 = new ToolStripSeparator();
			this.pmNoteQuery = new ToolStripMenuItem();
			this.pmViewNoteInfo = new ToolStripMenuItem();
			this.timLocateToday = new System.Windows.Forms.Timer(this.components);
			this.timLocateLastEditNote = new System.Windows.Forms.Timer(this.components);
			this.timQueryWjwsh = new System.Windows.Forms.Timer(this.components);
			this.menuStrip.SuspendLayout();
			this.contextMenuStrip.SuspendLayout();
			base.SuspendLayout();
            //this.imageList.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList.ImageStream");
            //this.imageList.TransparentColor = System.Drawing.Color.Transparent;
            //this.imageList.Images.SetKeyName(0, "Folder-Closed.ico");
            //this.imageList.Images.SetKeyName(1, "Card.ico");
            //this.imageList.Images.SetKeyName(2, "Card-Add.ico");
            //this.imageList.Images.SetKeyName(3, "Card-Delete.ico");
            //this.imageList.Images.SetKeyName(4, "Mail-Forward.ico");
            //this.imageList.Images.SetKeyName(5, "Connect.ico");
            //this.imageList.Images.SetKeyName(6, "Certificate.ico");
            //this.imageList.Images.SetKeyName(7, "Loginout.ico");
            //this.imageList.Images.SetKeyName(8, "key.ico");
            //this.imageList.Images.SetKeyName(9, "User-Add.ico");
            //this.imageList.Images.SetKeyName(10, "configure.ico");
            //this.imageList.Images.SetKeyName(11, "refresh.ico");
            //this.imageList.Images.SetKeyName(12, "Card-New.ico");
            //this.imageList.Images.SetKeyName(13, "Card-Edit.ico");
            //this.imageList.Images.SetKeyName(14, "convert.ico");
            //this.imageList.Images.SetKeyName(15, "search.ico");
            //this.imageList.Images.SetKeyName(16, "Export.ico");
            //this.imageList.Images.SetKeyName(17, "Flow Chart.ico");
            //this.imageList.Images.SetKeyName(18, "User-Edit.ico");
            //this.imageList.Images.SetKeyName(19, "User-Security-2.ico");
            //this.imageList.Images.SetKeyName(20, "296.ico");
            //this.imageList.Images.SetKeyName(21, "307.ico");
            //this.imageList.Images.SetKeyName(22, "folder.ico");
			this.menuStrip.BackColor = System.Drawing.Color.SteelBlue;
			this.menuStrip.Items.AddRange(new ToolStripItem[]
			{
				this.mmFile,
				this.mmSelfTask,
				this.mmMangerTask,
				this.mmHelp
			});
			this.menuStrip.Location = new System.Drawing.Point(0, 0);
			this.menuStrip.Name = "menuStrip";
			this.menuStrip.Size = new System.Drawing.Size(342, 25);
			this.menuStrip.TabIndex = 3;
			this.menuStrip.Text = "menuStrip1";
			this.mmFile.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.mmConnect,
				this.mmLogin,
				this.mmLogout,
				this.toolStripSeparator2,
				this.mmAlterPwd,
				this.mmNewUser,
				this.toolStripSeparator9,
				this.mmClientConfig,
				this.toolStripSeparator3,
				this.mmRefresh
			});
			this.mmFile.ForeColor = System.Drawing.Color.Gold;
			this.mmFile.Name = "mmFile";
			this.mmFile.Size = new System.Drawing.Size(59, 21);
			this.mmFile.Text = "系统(&S)";
			this.mmConnect.Name = "mmConnect";
			this.mmConnect.Size = new System.Drawing.Size(160, 22);
			this.mmConnect.Text = "连接服务器(&C)";
			this.mmConnect.Click += new EventHandler(this.mmConnect_Click);
			this.mmLogin.Enabled = false;
			this.mmLogin.Name = "mmLogin";
			this.mmLogin.Size = new System.Drawing.Size(160, 22);
			this.mmLogin.Text = "登录(&L)";
			this.mmLogin.Click += new EventHandler(this.mmLogin_Click);
			this.mmLogout.Enabled = false;
			this.mmLogout.Name = "mmLogout";
			this.mmLogout.Size = new System.Drawing.Size(160, 22);
			this.mmLogout.Text = "注销";
			this.mmLogout.Click += new EventHandler(this.mmLogout_Click);
			this.toolStripSeparator2.Name = "toolStripSeparator2";
			this.toolStripSeparator2.Size = new System.Drawing.Size(157, 6);
			this.mmAlterPwd.Enabled = false;
			this.mmAlterPwd.Name = "mmAlterPwd";
			this.mmAlterPwd.Size = new System.Drawing.Size(160, 22);
			this.mmAlterPwd.Text = "修改密码(&P)";
			this.mmAlterPwd.Click += new EventHandler(this.mmAlterPwd_Click);
			this.mmNewUser.Enabled = false;
			this.mmNewUser.Name = "mmNewUser";
			this.mmNewUser.Size = new System.Drawing.Size(160, 22);
			this.mmNewUser.Text = "注册新用户(&N)";
			this.mmNewUser.Click += new EventHandler(this.mmNewUser_Click);
			this.toolStripSeparator9.Name = "toolStripSeparator9";
			this.toolStripSeparator9.Size = new System.Drawing.Size(157, 6);
			this.mmClientConfig.Name = "mmClientConfig";
			this.mmClientConfig.Size = new System.Drawing.Size(160, 22);
			this.mmClientConfig.Text = "客户端参数配置";
			this.mmClientConfig.Click += new EventHandler(this.mmClientConfig_Click);
			this.toolStripSeparator3.Name = "toolStripSeparator3";
			this.toolStripSeparator3.Size = new System.Drawing.Size(157, 6);
			this.mmRefresh.Name = "mmRefresh";
			this.mmRefresh.Size = new System.Drawing.Size(160, 22);
			this.mmRefresh.Text = "刷新(&R)";
			this.mmRefresh.Click += new EventHandler(this.mmRefresh_Click);
			this.mmSelfTask.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.mmEditNote,
				this.mmDeleteNote,
				this.mmAlterNote,
				this.toolStripSeparator8,
				this.mmSynchronous,
				this.mmDownLoadNote,
				this.mmUpLoadNote,
				this.toolStripSeparator1,
				this.mmNoteQuery,
				this.mmViewWjwshrz,
				this.mmViewNoteInfo,
				this.toolStripMenuItem1,
				this.mmSendMsg,
				this.toolStripMenuItem2,
				this.mmWeekMonthSchedule,
				this.toolStripMenuItem3,
				this.mmDepCommunicationBook,
				this.toolStripMenuItem4,
				this.mmjkgzlMgr
			});
			this.mmSelfTask.ForeColor = System.Drawing.Color.Gold;
			this.mmSelfTask.Name = "mmSelfTask";
			this.mmSelfTask.Size = new System.Drawing.Size(71, 21);
			this.mmSelfTask.Text = "工作项(&T)";
			this.mmSelfTask.DropDownOpening += new EventHandler(this.mmTask_DropDownOpening);
			this.mmEditNote.Name = "mmEditNote";
			this.mmEditNote.Size = new System.Drawing.Size(196, 22);
			this.mmEditNote.Text = "编写日志(&W)";
			this.mmEditNote.Click += new EventHandler(this.mmEditNote_Click);
			this.mmDeleteNote.Enabled = false;
			this.mmDeleteNote.Name = "mmDeleteNote";
			this.mmDeleteNote.ShortcutKeys = Keys.Delete;
			this.mmDeleteNote.Size = new System.Drawing.Size(196, 22);
			this.mmDeleteNote.Text = "删除日志";
			this.mmDeleteNote.Click += new EventHandler(this.mmDeleteNote_Click);
			this.mmAlterNote.Enabled = false;
			this.mmAlterNote.Name = "mmAlterNote";
			this.mmAlterNote.Size = new System.Drawing.Size(196, 22);
			this.mmAlterNote.Text = "修改日志(&A)";
			this.mmAlterNote.Click += new EventHandler(this.mmAlterNote_Click);
			this.toolStripSeparator8.Name = "toolStripSeparator8";
			this.toolStripSeparator8.Size = new System.Drawing.Size(193, 6);
			this.mmSynchronous.Enabled = false;
			this.mmSynchronous.Name = "mmSynchronous";
			this.mmSynchronous.Size = new System.Drawing.Size(196, 22);
			this.mmSynchronous.Text = "日志同步(&T)";
			this.mmSynchronous.Click += new EventHandler(this.mmSynchronous_Click);
			this.mmDownLoadNote.Enabled = false;
			this.mmDownLoadNote.Name = "mmDownLoadNote";
			this.mmDownLoadNote.Size = new System.Drawing.Size(196, 22);
			this.mmDownLoadNote.Text = "下载日志(&D)";
			this.mmDownLoadNote.Click += new EventHandler(this.mmDownLoadNote_Click);
			this.mmUpLoadNote.Enabled = false;
			this.mmUpLoadNote.Name = "mmUpLoadNote";
			this.mmUpLoadNote.ShortcutKeys = (Keys)131157;
			this.mmUpLoadNote.Size = new System.Drawing.Size(196, 22);
			this.mmUpLoadNote.Text = "上传本地日志";
			this.mmUpLoadNote.Click += new EventHandler(this.mmUpLoadNote_Click);
			this.toolStripSeparator1.Name = "toolStripSeparator1";
			this.toolStripSeparator1.Size = new System.Drawing.Size(193, 6);
			this.mmNoteQuery.Enabled = false;
			this.mmNoteQuery.Name = "mmNoteQuery";
			this.mmNoteQuery.Size = new System.Drawing.Size(196, 22);
			this.mmNoteQuery.Text = "日志查询(&Q)";
			this.mmNoteQuery.Click += new EventHandler(this.mmNoteQuery_Click);
			this.mmViewWjwshrz.Enabled = false;
			this.mmViewWjwshrz.Name = "mmViewWjwshrz";
			this.mmViewWjwshrz.Size = new System.Drawing.Size(196, 22);
			this.mmViewWjwshrz.Text = "未交、未审核日志查询";
			this.mmViewWjwshrz.Click += new EventHandler(this.mmViewWjwshrz_Click);
			this.mmViewNoteInfo.Enabled = false;
			this.mmViewNoteInfo.Font = new System.Drawing.Font("Tahoma", 8.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
			this.mmViewNoteInfo.Name = "mmViewNoteInfo";
			this.mmViewNoteInfo.Size = new System.Drawing.Size(196, 22);
			this.mmViewNoteInfo.Text = "查看日志(&R)";
			this.mmViewNoteInfo.Click += new EventHandler(this.mmViewNoteInfo_Click);
			this.toolStripMenuItem1.Name = "toolStripMenuItem1";
			this.toolStripMenuItem1.Size = new System.Drawing.Size(193, 6);
			this.mmSendMsg.Enabled = false;
			this.mmSendMsg.Name = "mmSendMsg";
			this.mmSendMsg.Size = new System.Drawing.Size(196, 22);
			this.mmSendMsg.Text = "发送异常审核反馈信息";
			this.mmSendMsg.Click += new EventHandler(this.mmSendMsg_Click);
			this.toolStripMenuItem2.Name = "toolStripMenuItem2";
			this.toolStripMenuItem2.Size = new System.Drawing.Size(193, 6);
			this.mmWeekMonthSchedule.Enabled = false;
			this.mmWeekMonthSchedule.Name = "mmWeekMonthSchedule";
			this.mmWeekMonthSchedule.Size = new System.Drawing.Size(196, 22);
			this.mmWeekMonthSchedule.Text = "周计划、月报管理";
			this.mmWeekMonthSchedule.Visible = false;
			this.mmWeekMonthSchedule.Click += new EventHandler(this.mmWeekMonthSchedule_Click);
			this.toolStripMenuItem3.Name = "toolStripMenuItem3";
			this.toolStripMenuItem3.Size = new System.Drawing.Size(193, 6);
			this.toolStripMenuItem3.Visible = false;
			this.mmDepCommunicationBook.Enabled = false;
			this.mmDepCommunicationBook.Name = "mmDepCommunicationBook";
			this.mmDepCommunicationBook.Size = new System.Drawing.Size(196, 22);
			this.mmDepCommunicationBook.Text = "部门通讯录";
			this.mmDepCommunicationBook.Click += new EventHandler(this.mmGroupCom_Click);
			this.toolStripMenuItem4.Name = "toolStripMenuItem4";
			this.toolStripMenuItem4.Size = new System.Drawing.Size(193, 6);
			this.toolStripMenuItem4.Visible = false;
			this.mmjkgzlMgr.Name = "mmjkgzlMgr";
			this.mmjkgzlMgr.Size = new System.Drawing.Size(196, 22);
			this.mmjkgzlMgr.Text = "医保接口工作量管理";
			this.mmjkgzlMgr.Visible = false;
			this.mmjkgzlMgr.Click += new EventHandler(this.mmjkgzlMgr_Click);
			this.mmMangerTask.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.mmNoteCheck,
				this.mmWorkLoadAuditQuery,
				this.toolStripSeparator6,
				this.mmSysBasicData,
				this.mmPurviewMange,
				this.toolStripSeparator7,
				this.mmClearUserPwd
			});
			this.mmMangerTask.ForeColor = System.Drawing.Color.Gold;
			this.mmMangerTask.Name = "mmMangerTask";
			this.mmMangerTask.Size = new System.Drawing.Size(100, 21);
			this.mmMangerTask.Text = "管理员工作(&M)";
			this.mmNoteCheck.Enabled = false;
			this.mmNoteCheck.Name = "mmNoteCheck";
			this.mmNoteCheck.Size = new System.Drawing.Size(214, 22);
			this.mmNoteCheck.Text = "日志主管审核(&C)";
			this.mmNoteCheck.Click += new EventHandler(this.mmNoteCheck_Click);
			this.mmWorkLoadAuditQuery.Enabled = false;
			this.mmWorkLoadAuditQuery.Name = "mmWorkLoadAuditQuery";
			this.mmWorkLoadAuditQuery.Size = new System.Drawing.Size(214, 22);
			this.mmWorkLoadAuditQuery.Text = "工作日志审核状态查询(&Q)";
			this.mmWorkLoadAuditQuery.Click += new EventHandler(this.mmWorkLoadAudit_Click);
			this.toolStripSeparator6.Name = "toolStripSeparator6";
			this.toolStripSeparator6.Size = new System.Drawing.Size(211, 6);
			this.mmSysBasicData.Enabled = false;
			this.mmSysBasicData.Name = "mmSysBasicData";
			this.mmSysBasicData.Size = new System.Drawing.Size(214, 22);
			this.mmSysBasicData.Text = "系统基础数据设置";
			this.mmSysBasicData.Click += new EventHandler(this.mmDepData_Click);
			this.mmPurviewMange.Enabled = false;
			this.mmPurviewMange.Name = "mmPurviewMange";
			this.mmPurviewMange.Size = new System.Drawing.Size(214, 22);
			this.mmPurviewMange.Text = "用户基本信息维护(&P)";
			this.mmPurviewMange.Click += new EventHandler(this.mmPurviewMange_Click);
			this.toolStripSeparator7.Name = "toolStripSeparator7";
			this.toolStripSeparator7.Size = new System.Drawing.Size(211, 6);
			this.mmClearUserPwd.Enabled = false;
			this.mmClearUserPwd.Name = "mmClearUserPwd";
			this.mmClearUserPwd.Size = new System.Drawing.Size(214, 22);
			this.mmClearUserPwd.Text = "用户密码清空";
			this.mmClearUserPwd.Click += new EventHandler(this.mmQueryUserPwd_Click);
			this.mmHelp.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.mmBug,
				this.mmHelpCenter
			});
			this.mmHelp.ForeColor = System.Drawing.Color.Gold;
			this.mmHelp.Name = "mmHelp";
			this.mmHelp.Size = new System.Drawing.Size(96, 21);
			this.mmHelp.Text = "帮助与支持(&C)";
			this.mmBug.Name = "mmBug";
			this.mmBug.Size = new System.Drawing.Size(177, 22);
			this.mmBug.Text = "Bug与建议(&B)";
			this.mmBug.Click += new EventHandler(this.mmBug_Click);
			this.mmHelpCenter.Name = "mmHelpCenter";
			this.mmHelpCenter.Size = new System.Drawing.Size(177, 22);
			this.mmHelpCenter.Text = "帮助与支持中心(&H)";
			this.mmHelpCenter.Click += new EventHandler(this.mmHelpCenter_Click);
			this.treeViewNote.AllowDrop = true;
			this.treeViewNote.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.treeViewNote.BackColor = System.Drawing.Color.White;
			this.treeViewNote.ContextMenuStrip = this.contextMenuStrip;
			this.treeViewNote.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.treeViewNote.ForeColor = System.Drawing.SystemColors.InfoText;
			this.treeViewNote.ImageIndex = 0;
			this.treeViewNote.ImageList = this.imageList;
			this.treeViewNote.Location = new System.Drawing.Point(0, 27);
			this.treeViewNote.Name = "treeViewNote";
			this.treeViewNote.SelectedImageIndex = 0;
			this.treeViewNote.Size = new System.Drawing.Size(342, 438);
			this.treeViewNote.TabIndex = 4;
			this.treeViewNote.BeforeCollapse += new TreeViewCancelEventHandler(this.treeViewNote_BeforeCollapse);
			this.treeViewNote.BeforeExpand += new TreeViewCancelEventHandler(this.treeViewNote_BeforeExpand);
			this.treeViewNote.ItemDrag += new ItemDragEventHandler(this.treeViewNote_ItemDrag);
			this.treeViewNote.DragDrop += new DragEventHandler(this.treeViewNote_DragDrop);
			this.treeViewNote.DragEnter += new DragEventHandler(this.treeViewNote_DragEnter);
			this.treeViewNote.DoubleClick += new EventHandler(this.treeViewNote_DoubleClick);
			this.treeViewNote.KeyDown += new KeyEventHandler(this.treeViewNote_KeyDown);
			this.treeViewNote.MouseEnter += new EventHandler(this.treeViewNote_MouseEnter);
			this.contextMenuStrip.Items.AddRange(new ToolStripItem[]
			{
				this.pmEditNote,
				this.pmDeleteNote,
				this.pmAlterNote,
				this.toolStripSeparator10,
				this.pmSynchronous,
				this.pmUpLoadNote,
				this.toolStripSeparator4,
				this.pmRefresh,
				this.toolStripSeparator5,
				this.pmNoteQuery,
				this.pmViewNoteInfo
			});
			this.contextMenuStrip.Name = "contextMenuStrip";
			this.contextMenuStrip.Size = new System.Drawing.Size(161, 198);
			this.contextMenuStrip.Opening += new CancelEventHandler(this.contextMenuStrip_Opening);
			this.pmEditNote.Name = "pmEditNote";
			this.pmEditNote.Size = new System.Drawing.Size(160, 22);
			this.pmEditNote.Text = "编写日志(&W)";
			this.pmEditNote.Click += new EventHandler(this.pmEditNote_Click);
			this.pmDeleteNote.Name = "pmDeleteNote";
			this.pmDeleteNote.ShortcutKeys = Keys.Delete;
			this.pmDeleteNote.Size = new System.Drawing.Size(160, 22);
			this.pmDeleteNote.Text = "删除日志";
			this.pmDeleteNote.Click += new EventHandler(this.pmDeleteNote_Click);
			this.pmAlterNote.Name = "pmAlterNote";
			this.pmAlterNote.Size = new System.Drawing.Size(160, 22);
			this.pmAlterNote.Text = "修改日志(&A)";
			this.pmAlterNote.Click += new EventHandler(this.pmAlterNote_Click);
			this.toolStripSeparator10.Name = "toolStripSeparator10";
			this.toolStripSeparator10.Size = new System.Drawing.Size(157, 6);
			this.pmSynchronous.Name = "pmSynchronous";
			this.pmSynchronous.Size = new System.Drawing.Size(160, 22);
			this.pmSynchronous.Text = "日志同步(&T)";
			this.pmSynchronous.Click += new EventHandler(this.pmSynchronous_Click);
			this.pmUpLoadNote.Name = "pmUpLoadNote";
			this.pmUpLoadNote.Size = new System.Drawing.Size(160, 22);
			this.pmUpLoadNote.Text = "上传本地日志";
			this.pmUpLoadNote.Click += new EventHandler(this.pmUpLoadNote_Click);
			this.toolStripSeparator4.Name = "toolStripSeparator4";
			this.toolStripSeparator4.Size = new System.Drawing.Size(157, 6);
			this.pmRefresh.Name = "pmRefresh";
			this.pmRefresh.Size = new System.Drawing.Size(160, 22);
			this.pmRefresh.Text = "刷新(R)";
			this.pmRefresh.Click += new EventHandler(this.pmRefresh_Click);
			this.toolStripSeparator5.Name = "toolStripSeparator5";
			this.toolStripSeparator5.Size = new System.Drawing.Size(157, 6);
			this.pmNoteQuery.Name = "pmNoteQuery";
			this.pmNoteQuery.Size = new System.Drawing.Size(160, 22);
			this.pmNoteQuery.Text = "日志查询(&Q)";
			this.pmNoteQuery.Click += new EventHandler(this.pmNoteQuery_Click);
			this.pmViewNoteInfo.Font = new System.Drawing.Font("Tahoma", 8.25f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
			this.pmViewNoteInfo.Name = "pmViewNoteInfo";
			this.pmViewNoteInfo.Size = new System.Drawing.Size(160, 22);
			this.pmViewNoteInfo.Text = "查看日志(&R)";
			this.pmViewNoteInfo.Click += new EventHandler(this.pmViewNoteInfo_Click);
			this.timLocateToday.Interval = 500;
			this.timLocateToday.Tick += new EventHandler(this.timwait_Tick);
			this.timLocateLastEditNote.Interval = 500;
			this.timLocateLastEditNote.Tick += new EventHandler(this.timLocate_Tick);
			this.timQueryWjwsh.Interval = 500;
			this.timQueryWjwsh.Tick += new EventHandler(this.timQueryWjwsh_Tick);
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			this.BackColor = System.Drawing.Color.White;
			base.Controls.Add(this.treeViewNote);
			base.Controls.Add(this.menuStrip);
			base.Name = "NoteClientCtl";
			base.Size = new System.Drawing.Size(342, 465);
			base.Load += new EventHandler(this.NoteClientCtl_Load);
			this.menuStrip.ResumeLayout(false);
			this.menuStrip.PerformLayout();
			this.contextMenuStrip.ResumeLayout(false);
			base.ResumeLayout(false);
			base.PerformLayout();
		}
	}
}
